// 数据源、搜索对象、替换对象，该函数返回替换后的数据源
const empListAddCheckedStatus = function (source, newKey) {
  if (source === null) {
    return source;
  }
  let returnData = source.concat();
  for (let i = 0; i < source.length; i++) {
    if (source[i].userid === newKey.userid) {
      newKey.checked = true;
      returnData.splice(i, 1, newKey);
      break;
    }
  };
  return returnData;
};
export { empListAddCheckedStatus };
